commonlibsse_ng\re\t/
TESShout.rs

1use crate::re::BGSEquipType::{BGSEquipType, BGSEquipTypeVtbl};
2use crate::re::BGSMenuDisplayObject::{BGSMenuDisplayObject, BGSMenuDisplayObjectVtbl};
3use crate::re::FormTypes::FormType;
4use crate::re::SpellItem::SpellItem;
5use crate::re::TESDescription::{TESDescription, TESDescriptionVtbl};
6use crate::re::TESForm::TESForm;
7use crate::re::TESForm::TESFormVtbl;
8use crate::re::TESFullName::{TESFullName, TESFullNameVtbl};
9use crate::re::TESWordOfPower::TESWordOfPower;
10use crate::re::offsets_rtti::RTTI_TESShout;
11use crate::re::offsets_vtable::VTABLE_TESShout;
12use crate::rel::id::VariantID;
13
14#[repr(C)]
15#[derive(Debug)]
16pub struct TESShout {
17    pub __base: TESForm,
18    pub __base1: TESFullName,
19    pub __base2: BGSMenuDisplayObject,
20    pub __base3: BGSEquipType,
21    pub __base4: TESDescription,
22    pub variations: [Variation; 3], // 3: VariationID::count()
23}
24const _: () = assert!(core::mem::size_of::<TESShout>() == 0xA8);
25
26impl TESShout {
27    /// Address & offset of the runtime type information (RTTI) identifier.
28    pub const RTTI: VariantID = RTTI_TESShout;
29
30    /// Address & offset of the virtual function table.
31    ///
32    /// The number of tables is the same as the number of classes with inherited virtual functions.
33    pub const VTABLE: [VariantID; 5] = VTABLE_TESShout;
34
35    /// The `FormType` value for TESShout.
36    pub const FORM_TYPE: FormType = FormType::Shout;
37}
38
39#[repr(C)]
40pub struct TESShoutVtbl {
41    pub __base: TESFormVtbl,
42    pub __base1: TESFullNameVtbl,
43    pub __base2: BGSMenuDisplayObjectVtbl,
44    pub __base3: BGSEquipTypeVtbl,
45    pub __base4: TESDescriptionVtbl,
46}
47// const _: () = {
48//     const VTABLE_SIZE: usize = core::mem::size_of::<TESShoutVtbl>();
49//     const EXPECTED_SIZE: usize = (0x36 + 1) * core::mem::size_of::<usize>();
50//     assert!(VTABLE_SIZE == EXPECTED_SIZE);
51// };
52
53#[commonlibsse_ng_derive_internal::to_bitflags]
54#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
55#[repr(u32)]
56pub enum RecordFlag {
57    Deleted = 1 << 5,
58    TreatSpellsAsPowers = 1 << 7,
59    Ignored = 1 << 12,
60}
61
62#[commonlibsse_ng_derive_internal::ffi_enum]
63#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
64#[repr(u32)]
65pub enum VariationID {
66    One = 0,
67    Two,
68    Three,
69}
70
71impl VariationID {
72    pub const NONE: u32 = u32::MAX;
73}
74const _: () = assert!(VariationID_CEnum::count() == 3);
75
76#[derive(Debug)]
77pub struct Variation {
78    pub word: *mut TESWordOfPower, // 0x00
79    pub spell: *mut SpellItem,     // 0x08
80    pub recoveryTime: f32,         // 0x10
81    pub pad14: u32,                // 0x14
82}